package com.idata.model.Builder;

import com.idata.model.response.DisputeRelationResponse;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class DisputePersonBuilder {

    public static List<DisputeRelationResponse> transferFromDisputePersonMap(Map<String, String> disputePersonMap) {
        if (CollectionUtils.isEmpty(disputePersonMap)) {
            return new ArrayList<>();
        }
        return disputePersonMap.entrySet().stream()
                .map(entry -> new DisputeRelationResponse().setName(entry.getValue()).setIdCard(entry.getKey()))
                .collect(Collectors.toList());
    }
}
